package nfwx.analytics;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;

import static android.content.pm.PackageManager.GET_SIGNATURES;

/**
 * 填充视频会话信息工具类
 */

public class GrabVideoSessionFiller {
    static void fill(GrabVideoSession session, Context ctx)
    {
        //填充版本信息
        try {
            PackageInfo info = ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), GET_SIGNATURES);
            session.app.ver.setValue(info.versionName);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
    }
}
